def read_data(out_file_path) :
    done_list = []
    with open(out_file_path, 'r') as out_file :
        while True :
            doneuser = out_file.readline()
            if doneuser :
                done_list.append(doneuser[:-1])
            else :
                break
    return done_list

def read_userinfo(userinfo_path) :
    userinfos = {}
    with open(userinfo_path, 'r', encoding='utf-8') as userinfo_file :
        while True :
            userinfo_line = userinfo_file.readline()
            if not userinfo_line :
                break
            userinfo = userinfo_line.split(' ')
            userid = userinfo[0]
            username = userinfo[1]
            usercard = userinfo[2]
            userbirth = userinfo[3][:-1]
            userinfos[userid] = {
                'username': username,
                'usercard': usercard,
                'userbirth': userbirth
            }
    return userinfos

if __name__ == '__main__' :

    done = read_data('done.txt')
    print(done)

    userinfos = read_userinfo('userinfos.txt')
    print(userinfos)

    while True :
        userid = input("账号: ")
        print(userinfos[userid])